package com.springboot.project.entity;

import com.springboot.project.common.ExcelResultEnum;

public class ExcelResult {
    /**
     * Result code.
     */
    private String code;
    /**
     * Result message, mainly used for error message.
     */
    private String message;
    /**
     * Result data which contains resource entity.
     */
    private Object data;

    /**
     * Contains expand data of resource entity.
     */
    private Object expand;

    public ExcelResult() {
        this(ExcelResultEnum.SUCCESS);
    }

    /**
     *
     * @param o
     */
    public ExcelResult(Object o) {
        this(ExcelResultEnum.SUCCESS);
        this.data = o;
    }

    /**
     *
     * @param code
     */
    public ExcelResult(ExcelResultEnum code) {
        this(code.getCode(), code.getDesc());
    }

    /**
     *
     * @param code
     * @param message
     */
    private ExcelResult(Integer code, String message) {
        this.code = String.valueOf(code);
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Object getExpand() {
        return expand;
    }

    public void setExpand(Object expand) {
        this.expand = expand;
    }
}
